//
// Created by chengang on 2021/4/15.
//
#include  <android/log.h>
#include <string>
#define  TAG    "cdglog"
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, TAG, __VA_ARGS__)
double division(int a, int b);

void do_test(){
    LOGD("do test start");
    int x = 50;
    int y = 0;
    double z = 0;
     try {
         z = division(x, y);
     } catch (const char* msg) {
         LOGD("E Msg : %s",msg);
     }

}

double division(int a, int b)
{
    if( b == 0 )
    {
        throw "Division by zero condition!";
    }
    return (a/b);
}

